package com.atguigu.gmall.product.api;

import com.atguigu.gmall.model.product.SkuInfo;
import com.atguigu.gmall.product.service.ManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: zm
 * @Date: 2021/8/16 21:40
 */
@RestController
@RequestMapping("api/product")
public class Product2ActivityController {
    @Autowired
    private ManageService manageService;

    /**
     * 根据 skuIdList 获取 SkuInfoList
     *
     * @param ids
     * @return
     */
    @PostMapping("inner/getSkuInfoList")
    public List<SkuInfo> getSkuInfoList(@RequestBody List<Long> ids) {
        return manageService.getSkuInfoListToActivity(ids);
    }

    @GetMapping("inner/findSkuInfoByKeyword/{keyWord}")
    public List<SkuInfo> findSkuInfoByKeyword(@PathVariable("keyWord") String keyWord){
    return manageService.findSkuInfoByKeyword(keyWord);
    }

}
